cv.ses(target, dataset, kfolds = 10, folds = NULL, alphas = NULL, max_ks = NULL,
task = NULL, metric = NULL, modeler = NULL, ses_test = NULL, ncores = 1)
cv.mmpc(target, dataset, kfolds = 10, folds = NULL, alphas = NULL, max_ks = NULL,
task = NULL, metric = NULL, modeler = NULL, mmpc_test = NULL, ncores = 1)
Input for metric functions: predictions: A vector of predictions to be tested. test_target: target variable actual values to be compared with the predictions.
The output of a metric function is a single numeric value. Higher values indicate better performance. Metric based on error measures should be modified accordingly (e.g., multiplying the error for -1)
The metric functions that are currently supported are:
Usage: metric(predictions, test_target)
Input of modelling functions: train_target: target variable used in the training procedure. sign_data: training set. sign_test: test set.
Modelling functions provide a single vector of predictions obtained by applying the model fit on sign_data and train_target on the sign_test
The modelling functions that are currently supported are:
Usage: modeler(train_target, sign_data, sign_test)
Note that the Tibshirani and Tibshirani (2009) bias correction method is applied. The procedure will be more automated in the future and more functions will be added. The multithreaded functions have been tested and no error has been detected. However, if you spot any suspicious results please let us know.
SES, CondIndTests, testIndFisher, testIndLogistic, gSquare, censIndCR
set.seed(1234)
# simulate a dataset with continuous data
dataset <- matrix( rnorm(100 * 100), ncol = 100 )
# the target feature is the last column of the dataset as a vector
target <- dataset[, 100]
dataset <- dataset[, -100]
# get 50 percent of the dataset as a train set
train_set <- dataset[1:50, ]
train_target <- target[1:50]
require(hash)
# run a 10 fold CV for the regression task
best_model = cv.ses(target = train_target, dataset = train_set, kfolds = 10, task = "R")
# get the results
best_model$best_configuration
best_model$best_performance
# summary elements of the process. Press tab after each $ to view all the elements and
# choose the one you are intresting in.
# best_model$cv_results_all[[...]]$...
#i.e.
# mse value for the 1st configuration of SES of the 5 fold
abs(best_model$cv_results_all[[1]]$performances[5])
best_a <- best_model$best_configuration$a
best_max_k <- best_model$best_configuration$max_k
Run the code above in your browser using DataLab